/* 
 * To change this template, choose Tools | Templates
 * and open the template in the editor.
 */

function changeTitleDialog(title){
  $("#ui-dialog-title-dialogInputForm").html(title);  
}

function openDialog(title,width,hight){
  if (title != '') $("#ui-dialog-title-dialogInputForm").html(title);   
  if (width > 0) $("#dialogInputForm").dialog('option','width',width);
  if (hight > 0) $("#dialogInputForm").dialog('option','height',hight);
  $('#dialogInputForm').dialog('open');
}

function verifyDelete(){
    var arr_id = new Array();
    arr_id = $.fn.yiiGridView.getChecked("DataGrid","chkId");
    var remind_content = 'Please select row(s) to delete!\n\
                            <div style="text-align:center; margin-top:10px;">\n\
                                <button id="btnOk" name="btnOk" class="ok" onclick="$(&#039;#dialogInputForm&#039;).dialog(&#039;close&#039;)">\n\
                                    Ok\n\
                                </button>\n\
                            </div>';
    var confirm_content ='Are you sure you want to delete?\n\
                        <div style="text-align:center; margin-top:10px;">\n\
                            <button id="btnOk" name="btnOk" class="ok" onclick="{submitDeleting();return false;}">\n\
                                Ok\n\
                            </button>\n\
                            <button id="btnCancel" name="btnCancel" class="cancel" onclick="$(&#039;#dialogInputForm&#039;).dialog(&#039;close&#039;)">\n\
                                Cancel\n\
                            </button>\n\
                        </div>';
    if(arr_id.length == 0)
        $('#dialogInputForm div.divForForm').html(remind_content);
    else
        $('#dialogInputForm div.divForForm').html(confirm_content);
}
